package com.example.websocket;

import java.util.HashMap;

class WebSocketInfoPool {
    private HashMap<String, WebSocketInfo> pool=new HashMap<>();
    public WebSocketInfo obtain(String url) {
        if(pool.containsKey(url)){
            return pool.get(url);
        }
        WebSocketInfo webSocketInfo=new WebSocketInfo();
        pool.put(url, webSocketInfo);
        return webSocketInfo;
    }
}
